package com.ruoyi.system.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.EmployeeAssessmentDetail;
import com.ruoyi.system.domain.vo.DetailVO;
import com.ruoyi.system.service.IDetailService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/jixiao/assessmentProgress")
public class DetailController extends BaseController {
    @Autowired
    private IDetailService detailService;
    @GetMapping("/getDetailVOList")
    public TableDataInfo list(@Param("departmentId") Long departmentId,@Param("assessmentStatus") String assessmentStatus){
        //1必选id 2：可选考核状态
        startPage();
        List<DetailVO> detailVOList = detailService.getDetailVOList(departmentId,  assessmentStatus);
        return getDataTable(detailVOList);
    }

    @PutMapping("/updateAssessmentStatus")
    public AjaxResult updateAssessmentStatus(@RequestBody EmployeeAssessmentDetail employeeAssessmentDetail){
        return toAjax(detailService.updateAssessmentStatus(employeeAssessmentDetail));
    }



}
